<!doctype html>
<html data-theme="light" class="light">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    @vite('resources/css/app.css')
    @vite('resources/js/app.js')
</head>
<body class="bg-gray-200 dark:bg-gray-700 min-vh-100">

<header class="pt-4 ">
    <div class="  navbar bg-base-100 container mx-auto rounded-2xl  px-10 ">
        <div class="navbar-start">
            <div class="dropdown">
                <div tabindex="0" role="button" class="btn btn-ghost lg:hidden">
                    <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24"
                         stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                              d="M4 6h16M4 12h8m-8 6h16"/>
                    </svg>
                </div>
                <ul tabindex="0"
                    class="menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-52">
                    <li><a
                            @if(request()->getRequestUri() =='/')  class="active"  @endif
                        href="/"  >首页 </a></li>
                    <li><a      @if(str_starts_with(request()->getRequestUri(), '/categorySearch'))  class="active"  @endif href="/categorySearch">分类检索</a></li>
                    <li><a   @if(request()->getRequestUri() =='/chat')  class="active"  @endif href="/chat">聊天室</a></li>
                </ul>
            </div>
            <a href="/" class="btn btn-ghost text-xl">极客图书</a>
        </div>
        <div class="navbar-center hidden lg:flex">
            <ul class="menu menu-horizontal px-1">
                <li><a
                        @if(request()->getRequestUri() =='/')  class="active"  @endif
                       href="/"  >首页 </a></li>
                <li><a      @if(str_starts_with(request()->getRequestUri(), '/categorySearch'))  class="active"  @endif href="/categorySearch">分类检索</a></li>
                <li><a   @if(request()->getRequestUri() =='/chat')  class="active"  @endif href="/chat">聊天室</a></li>
            </ul>
        </div>
        <div class="navbar-end">
            <label class="swap swap-rotate mr-4 ">
                <!-- this hidden checkbox controls the state -->
                <input type="checkbox" class="theme-controller" value="dark"/>
                <!-- sun icon -->
                <svg class="swap-off fill-current change-theme w-8 h-8" xmlns="http://www.w3.org/2000/svg"
                     viewBox="0 0 24 24">
                    <path
                        d="M5.64,17l-.71.71a1,1,0,0,0,0,1.41,1,1,0,0,0,1.41,0l.71-.71A1,1,0,0,0,5.64,17ZM5,12a1,1,0,0,0-1-1H3a1,1,0,0,0,0,2H4A1,1,0,0,0,5,12Zm7-7a1,1,0,0,0,1-1V3a1,1,0,0,0-2,0V4A1,1,0,0,0,12,5ZM5.64,7.05a1,1,0,0,0,.7.29,1,1,0,0,0,.71-.29,1,1,0,0,0,0-1.41l-.71-.71A1,1,0,0,0,4.93,6.34Zm12,.29a1,1,0,0,0,.7-.29l.71-.71a1,1,0,1,0-1.41-1.41L17,5.64a1,1,0,0,0,0,1.41A1,1,0,0,0,17.66,7.34ZM21,11H20a1,1,0,0,0,0,2h1a1,1,0,0,0,0-2Zm-9,8a1,1,0,0,0-1,1v1a1,1,0,0,0,2,0V20A1,1,0,0,0,12,19ZM18.36,17A1,1,0,0,0,17,18.36l.71.71a1,1,0,0,0,1.41,0,1,1,0,0,0,0-1.41ZM12,6.5A5.5,5.5,0,1,0,17.5,12,5.51,5.51,0,0,0,12,6.5Zm0,9A3.5,3.5,0,1,1,15.5,12,3.5,3.5,0,0,1,12,15.5Z"/>
                </svg>
                <!-- moon icon -->
                <svg class="swap-on fill-current change-theme w-8 h-8" xmlns="http://www.w3.org/2000/svg"
                     viewBox="0 0 24 24">
                    <path
                        d="M21.64,13a1,1,0,0,0-1.05-.14,8.05,8.05,0,0,1-3.37.73A8.15,8.15,0,0,1,9.08,5.49a8.59,8.59,0,0,1,.25-2A1,1,0,0,0,8,2.36,10.14,10.14,0,1,0,22,14.05,1,1,0,0,0,21.64,13Zm-9.5,6.69A8.14,8.14,0,0,1,7.08,5.22v.27A10.15,10.15,0,0,0,17.22,15.63a9.79,9.79,0,0,0,2.1-.22A8.11,8.11,0,0,1,12.14,19.73Z"/>
                </svg>
            </label>
            @guest
                <a class="btn  btn-sm" href="/login">登录</a>
            @else
                <a class="btn  btn-sm" href="/userCenter">  <img style="width:20px" class="rounded-2xl"
                        src="https://ui-avatars.com/api/?name={{ auth()->user()->nickname }}"/>{{ auth()->user()->level->name }} {{ auth()->user()->nickname }}</a>
                <a class="btn btn-secondary btn-sm ml-6" href="/logout">退出登录</a>
            @endguest
        </div>
    </div>
</header>

@auth
    @if(auth()->user()->is_manage ==2 && auth()->user()->status == 0)
    <div class="container mx-auto mt-6">
        <div role="alert" class="alert alert-info mb-10">
            <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-current shrink-0 w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
            <p class="text-white">请联系后台管理员审核</p>
        </div>
    </div>
    @endif
@endauth

@if(!empty(session('success')))
   <div class="container mx-auto mt-6">
       <div class="alert " role="alert">
           {{session('success')}}
       </div>
   </div>
@endif

@if ($errors->any())
    <div class="container mx-auto mt-6">
        <div role="alert" class="alert alert-error mb-10">
            <svg xmlns="http://www.w3.org/2000/svg" class="stroke-current shrink-0 h-6 w-6" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
            <ul>
                @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
    </div>
@endif


@yield('content')


<footer class="container mx-auto rounded-2xl mt-10 footer footer-center p-10 bg-primary text-primary-content">
    <aside>
        <img src="/assets/images/book.png" class="w-20" alt="">
        <p class="font-bold">
            极客图书 Ltd.
        </p>
        <p>Copyright © 2024 - All right reserved</p>
    </aside>

</footer>
</body>
</html>

































































